<?php
defined('IN_TS') or die('Access Denied.');

function killip(){

	global $TS_USER;
	
	if($TS_USER['user']['userid']){
	
		$ip = getIp();
		
		$ips = fileRead('plugins/pubs/killip/data.php');
		
		$arrIps = explode('|',$ips);
		
		if($ip){
			if(in_array($ip,$arrIps)){
				header('Location: '.SITE_URL.tsUrl('user','login',array('ts'=>'out')));
			}
		}
	}
	
}

addAction('beforeAction','killip');